From: kaf24@firebug.cl.cam.ac.uk Date: Wed, 9 Mar 2005 10:08:43 +0000 (+0000) Subject: bitkeeper revision 1.1236.12.19 (422ecb2bc2t7QxV32i8WkcYdNFkamw) X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~17857^2~57^2~7 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=cc459d4daa7e39c447e4e59ab2431de257f635a9;p=xen.git bitkeeper revision 1.1236.12.19 (422ecb2bc2t7QxV32i8WkcYdNFkamw) A few x86/64 fixes for Jun. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 4be8043bef..c19bc39bcd 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -697,7 +697,8 @@ long do_switch_to_user(void) regs->rcx = stu.rcx; } - return regs->rax; + /* Saved %rax gets written back to regs->rax in entry.S. */ + return stu.rax; } #elif defined(__i386__) diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S index 181e2e3ce4..93bd397386 100644 --- a/xen/arch/x86/x86_64/entry.S +++ b/xen/arch/x86/x86_64/entry.S @@ -243,6 +243,7 @@ FLT15: movq %rax,(%rsi) # RCX movq %rax,XREGS_rip+8(%rsp) movb $0,TRAPBOUNCE_flags(%rdx) testb $TF_kernel_mode,EDOMAIN_thread_flags(%rbx) + movq %rbx,%rdi # toggle_guest_mode(current) jz SYMBOL_NAME(toggle_guest_mode) ret .section .fixup,"ax" diff --git a/xen/include/public/arch-x86_64.h b/xen/include/public/arch-x86_64.h index 21299c974c..6a9ee1dcf7 100644 --- a/xen/include/public/arch-x86_64.h +++ b/xen/include/public/arch-x86_64.h @@ -95,18 +95,18 @@ /* * int HYPERVISOR_switch_to_user(void) - * All arguments are on the kernel stack, in the following format. + * All arguments are on the kernel stack, in the following format. * Never returns if successful. Current kernel context is lost. * If flags contains ECF_IN_SYSCALL: - * Restore RIP, RFLAGS, RSP. + * Restore RAX, RIP, RFLAGS, RSP. * Discard R11, RCX, CS, SS. * Otherwise: - * Restore R11, RCX, CS:RIP, RFLAGS, SS:RSP. + * Restore RAX, R11, RCX, CS:RIP, RFLAGS, SS:RSP. * All other registers are saved on hypercall entry and restored to user. */ struct switch_to_user { /* Top of stack (%rsp at point of hypercall). */ - u64 r11, rcx, flags, rip, cs, rflags, rsp, ss; + u64 rax, r11, rcx, flags, rip, cs, rflags, rsp, ss; /* Bottom of switch_to_user stack frame. */ } PACKED;